package com.zcup.designer.contribute.reflectabsfactory;

public class Creator {
    private static final String packageName = Creator.class.getPackage().getName();

    static AbstractProduct create(String type, Integer order) {
        try {
            return (AbstractProduct) Class.forName(packageName + "." + "Product" + type.toUpperCase() + order).newInstance();
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
